import React, { Component } from 'react'
import { Form, Input, } from 'antd';

export default class AddRole extends Component {

  myForm = React.createRef()
  UNSAFE_componentWillMount () {
    this.props.addform (this.myForm)
  }

  componentDidMount(){
    this.myForm.current.setFieldsValue()
  }
  
  render () {

    const formItemLayout = {
      labelCol: { span: 4 },
      wrapperCol: { span: 20 }
    }

    return (
      <Form
      // layout="vertical"
      name="form_in_modal"
      ref={this.myForm}
      {...formItemLayout}
      // initialValues={}
    >

      <Form.Item name="roleName" label='角色名称'
        rules={[
          { 
            required: true,
            message: '角色名称必须输入' }
        ]}>
        <Input  placeholder='请输入角色名' />
      </Form.Item>
    </Form>
    )
  }
   

  
}
